package com.icss.clothes.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    //配置静态资源的映射规则
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //假设访问路径为clothes/cover1.jdg——》D:\\clothes\\cover1.jdg
        registry.addResourceHandler("/clothes/**")
                .addResourceLocations("file:D:\\IdeaIU\\Clother_shopping\\commodity\\");
    }
}
